<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>

<f:subview id="searchResult">
<h:form id="searchResultForm">
<h:outputText value="No results were found for your search." styleClass="title" rendered="#{searchPageBean.pagedListHolder.nrOfElements == 0}"/>
<h:outputText value="#{searchPageBean.pagedListHolder.nrOfElements} products matching any of: " styleClass="title" rendered="#{searchPageBean.pagedListHolder.nrOfElements > 0}"/>
<h:outputText value="#{searchPageBean.keywords}" style="color:green" styleClass="header" rendered="#{searchPageBean.pagedListHolder.nrOfElements > 0}"/>
<h:dataTable id="table" value="#{searchPageBean.pagedListHolder.pageList}" var="product" 
	styleClass="box" columnClasses=", rightAlign"
	rendered="#{searchPageBean.pagedListHolder.nrOfElements > 0}">
  <h:column>
    <h:panelGrid columns="1">
      <h:outputLink  value="product.jsf?productId=#{product.productId}">
          <h:outputText value="#{product.name}"/>
      </h:outputLink>
      <h:outputText value="#{product.description}" />
    </h:panelGrid>
  </h:column>
</h:dataTable>
<h:panelGrid columns="1" styleClass="standard" columnClasses="rightAlign">
  <h:panelGroup>
    <h:commandLink action="#{searchPageBean.navigateAction}" rendered="#{!searchPageBean.pagedListHolder.firstPage}">
      <h:outputText value=" Prev "/>
      <f:param name="page" value="previous"/>
    </h:commandLink>
    <h:commandLink action="#{searchPageBean.navigateAction}" rendered="#{!searchPageBean.pagedListHolder.lastPage}">
      <h:outputText value=" Next "/>
      <f:param name="page" value="next"/>
    </h:commandLink>
  </h:panelGroup>
</h:panelGrid>
</h:form>
</f:subview>